package hr.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import hr.entity.MovementLog;
import hr.mapper.MovementLogMapper;
import hr.service.MovementLogService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 岗位调动日志 服务实现类
 * </p>
 *
 * @author zzh
 * @since 2023-12-16
 */
@Service
public class MovementLogServiceImpl extends ServiceImpl<MovementLogMapper, MovementLog> implements MovementLogService {
    @Autowired
    private MovementLogMapper movementLogMapper;

    @Override
    public IPage<MovementLog> selectPage(Page<MovementLog> pageParam, MovementLog movementLog) {
        IPage<MovementLog> page = movementLogMapper.selectPage(pageParam, new QueryWrapper<>(movementLog));
        return page;
    }

    @Override
    public List<MovementLog> findByName(String name) {
        return movementLogMapper.selectList(new QueryWrapper<MovementLog>().like("name", name));
    }
}
